package com.bawei.model_sevent.Activity.Adapter;

import android.widget.CheckBox;
import android.widget.ImageView;

import com.bawei.model_sevent.Activity.Banner.BannerBean;
import com.bawei.model_sevent.Activity.MySql.MySqlBean;
import com.bawei.model_sevent.R;
import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.List;

/**
 * 时间：2021/11/16 15:47.
 * 类名：HuoBaoAdapter
 * 作用：Model_sevent
 * 作者:张羽_zy
 */
public class ShoppingAdapter extends BaseQuickAdapter<MySqlBean, BaseViewHolder> {


    public ShoppingAdapter(@Nullable List<MySqlBean> data) {
        super(R.layout.show_shopping, data);
        addChildClickViewIds(R.id.show_shoping);
        addChildClickViewIds(R.id.cb);
        addChildClickViewIds(R.id.add66);
        addChildClickViewIds(R.id.del);
        addChildClickViewIds(R.id.img);
    }
    

    @Override
    protected void convert(@NotNull BaseViewHolder baseViewHolder, MySqlBean mySqlBean) {
        baseViewHolder.setText(R.id.sum,mySqlBean.content+"");
        CheckBox view = baseViewHolder.getView(R.id.cb);
        view.setChecked(mySqlBean.checkBox);
        baseViewHolder.setText(R.id.tv,mySqlBean.getName());
        Glide.with(getContext()).load(mySqlBean.getImages()).into((ImageView) baseViewHolder.getView(R.id.img));
    }
}
